//最开始用这种写法构建完整的杨辉三角,结果发现超出时间限制了,这题本意是要找规律,故换一种思路
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = 2*n-1;
        int[][] arr = new int[n][m];
        //初始化
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                arr[i][j] = 0;
            }
        }
        arr[0][0] = 1;
        for(int i = 1; i < n ; i++){
            arr[i][0] = arr[i][i*2] = 1;
            for(int j = 1; j < i*2; j++){
                if(j == 1){
                    arr[i][j] = arr[i-1][j] + arr[i-1][j-1];
                }else{
                    arr[i][j] = arr[i-1][j] + arr[i-1][j-1] + arr[i-1][j-2];
                }
            }
        }
        boolean flg = false;
        for(int i = 1; i < m ; i++){
            if(arr[n-1][i] % 2 == 0){
                flg = true;
                System.out.println(i+1);
                break;
            }
        }
        if(!flg) System.out.println(-1);
    }
}


//经找规律得,可以发现，从第3行开始，偶数出现的位置依次为 2,3,2,4
import java.util.Scanner;
public class Main {
    public static int solve(int n) {
        if (n == 1 || n == 2) {
            return -1;
        }
        if (n % 4 == 3 || n % 4 == 1) {
            return 2;
        }
        if (n % 4 == 0) {
            return 3;
        }
        if (n % 4 == 2) {
            return 4;
        }
        return -1;
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            System.out.println(solve(n));
        }
    }
}
